package com.hjw.java.abstract_demo1;

/**
 * @author hjwStrart
 * @create 2022-01-13 11:18
 */
public class TestDemo1 {
    public static void main(String[] args) {
        Mall mall = new Mall();
        Card card = mall.applyForACard(5555.0, "hjw");
        Double paymentAmount = 123.45;
        Boolean pay = card.pay(paymentAmount);
        if(pay){
            System.out.println("支付成功，支付金额："+ paymentAmount + "\n实际支付：" + paymentAmount * card.getDiscount() + "\n剩余可用金额：" + card.getBalance());
        }else{
            System.out.println("余额不足，支付失败，当前余额："+ card.getNoCard());
        }
    }
}
